#ifndef THREADEX_H
#define THREADEX_H

#include <qthread>
#include <QEventLoop>
#include <QObject>
#include <QMovie>
#include <QLabel>
#include<debugx>
#if defined(PLUGINCORE_LIBRARY)
#define PLUGINCORE_EXPORT Q_DECL_EXPORT
#else
#define PLUGINCORE_EXPORT Q_DECL_IMPORT
#endif

class  PLUGINCORE_EXPORT ThreadEx : public QThread
{
    Q_OBJECT
public:
    explicit ThreadEx(QObject *parent = nullptr);

    unsigned long sleepMS=10;
    bool stop=false;
    void setStop(){stop=true;}

signals:
    void sig_user(void *data);
    void sig_progress(int index);

};





class PLUGINCORE_EXPORT ThreadGif:public ThreadEx
{
    Q_OBJECT

public:
    ThreadGif(const QString gifpath,int speed=100);
    QString gifPath;
    QLabel *label;
    QMovie *movie;
    int speed;
    void run();
};



#endif // THREADEX_H
